//
//  BaseHeader.h
//  zdOrderPlatform
//
//  Created by dfwx on 2020/8/26.
//  Copyright © 2020 zhongdaodianzi. All rights reserved.
//

#ifndef BaseHeader_h
#define BaseHeader_h
#import "MBProgressHUD.h"
#import "YYModel.h"
#import "MJRefresh/UIView+MJExtension.h"
#import "UIImageView+WebCache.h"
#import "Masonry.h"
#import "IQKeyboardManager.h"
#import "UIButton+Extension.h"
#import "NSString+Extension.h"
#import "NSData+Extension.h"
#import "NSArray+Safe.h"
#import "NSDictionary+Safe.h"
#import "NSMutableArray+Safe.h"
#import "NSMutableDictionary+Safe.h"
#import "NSObject+ImpChangeTool.h"
#import "NSObject+NullData.h"
#import "NSString+json.h"
#import "NSString+Timestamp.h"
#import "UIImage+Extension.h"
#import "UIImage+Orientation.h"
#import "UIViewController+BackButtonItem.h"
#import "UIViewController+HUD.h"
#import "UIViewController+Init.h"
#import "YBBaseNavigationController.h"
#import <AFNetworking.h>
#import <CoreBluetooth/CoreBluetooth.h>


#define ScreenHeight [[UIScreen mainScreen] bounds].size.height
#define ScreenWidth [ UIScreen mainScreen ].bounds.size.width

#define YBRedColor UIColorFromHex(0xff0048)
#define YBGreenColor UIColorFromHex(0x318f69)
#define YBOrangeColor UIColorFromHex(0xFF8C00)
#define YBCyanColor UIColorFromHex(0x17c3d2)
#define YBLightCyanColor UIColorFromHex(0xbefaff)
#define YBMainTitleColor UIColorFromHex(0x1a1a1a)
#define YBMidTitleColor UIColorFromHex(0x979797)
#define YBSubTitleColor UIColorFromHex(0xa4a4a4)
#define YBBackgroundColor UIColorFromHex(0xf7f7f7)
#define YBLayerBorderColor UIColorFromHex(0xe8e8e8)
#define YBImageViewBackgroundColor UIColorFromHex(0xe0e4e4)
#define ISOrangeColor UIColorFromHex(0xFFA042)

#define KCGBlackColor UIColorFromHex(0x13181C)
#define KCGStatusBarHeight  [[UIApplication sharedApplication] statusBarFrame].size.height

#define MSMainColor UIColorFromHex(0x008CCC)

#define IS_GREATER_THAN_IOS9 [[UIDevice currentDevice].systemVersion floatValue] >= 10.0
#define IS_LOWER_THAN_IOS11 [[UIDevice currentDevice].systemVersion floatValue] < 11.0

#define UIColorFromHex(hex) [UIColor colorWithRed:((float)((hex & 0xFF0000) >> 16))/255.0 green:((float)((hex & 0xFF00) >> 8))/255.0 blue:((float)(hex & 0xFF))/255.0 alpha:1.0]

#define UIAlphaColorFromHex(hex, alphaValue) [UIColor colorWithRed:((float)((hex & 0xFF0000) >> 16))/255.0 green:((float)((hex & 0xFF00) >> 8))/255.0 blue:((float)(hex & 0xFF))/255.0 alpha:alphaValue]

#define KCGStatusBarHeight  [[UIApplication sharedApplication] statusBarFrame].size.height
#define NUM @"0123456789"
#define ALPHA @"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
#define ALPHANUM @"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"

#define isIphoneX ({\
BOOL tmp = NO;\
if (@available(iOS 11.0, *)) {\
if ([UIApplication sharedApplication].delegate.window.safeAreaInsets.top > 20) {\
tmp = YES;\
}else{\
tmp = NO;\
}\
}else{\
tmp = NO;\
}\
tmp;\
})
// 接口文档  http://8.129.221.117:8080/doc.html
#define APPURL      @"http://8.129.221.117:8080/"
#define APPImageURL  @"http://8.129.221.117:8080/sys/downFile?fileId="

#define SQL_Contact @"sql_contact"

#define left_peripheral_name @"left_peripheral_name"
#define right_peripheral_name @"right_peripheral_name"
#define left_peripheral_password    @"left_peripheral_password"
#define right_peripheral_password    @"right_peripheral_password"
#define left_peripheral_learn_data      @"left_peripheral_learn_data"
#define right_peripheral_learn_data      @"right_peripheral_learn_data"
#define noLonger_show_key   @"noLonger_show_key"
#define isFirstLogin    @"isFirstLogin"

#define WWNSLocalizedString(Context,temp)  [NSString stringWithFormat:@"%@", [[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"%@",[[NSUserDefaults standardUserDefaults] objectForKey:@"appLanguage"]] ofType:@"lproj"]] localizedStringForKey:(Context) value:nil table:nil]]

#define NSLog(format, ...) printf("class: <%p %s:(%d) > method: %s \n%s\n", self, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, __PRETTY_FUNCTION__, [[NSString stringWithFormat:(format), ##__VA_ARGS__] UTF8String] )



//#ifdef DEBUG
//#define NSLog(FORMAT, ...) fprintf(stderr,"\n %s:%d   %s\n",[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String],__LINE__, [[[NSString alloc] initWithData:[[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] dataUsingEncoding:NSUTF8StringEncoding] encoding:NSNonLossyASCIIStringEncoding] UTF8String]);
//#else
//#define NSLog(...)
//#endif

#endif /* BaseHeader_h */
